package com.heima.article.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.heima.model.article.dtos.ArticleHomeDto;
import com.heima.model.article.pojos.ApArticle;
import com.heima.model.comment.dtos.CommentPageDto;
import com.heima.model.comment.vos.ArticleCommnetVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;
import java.util.Map;

@Mapper
public interface ApArticleMapper extends BaseMapper<ApArticle> {

    /**
     * 加载文章列表
     *
     * @param
     * @param
     * @return
     */

    public List<ApArticle> loadArticleList(@Param("dto") ArticleHomeDto dto, @Param("type") Short type);


    public List<ApArticle> findArticleListByLast5days(@Param("dayParam") Date dayParam);

    /**
     * 查看文章统计
     * @param wmUserId
     * @param beginDate
     * @param endDate
     * @return
     */

    Map getNewsDimension(@Param("wmUserId") Integer wmUserId, @Param("beginDate") Date beginDate, @Param("endDate") Date endDate);

    List<ArticleCommnetVo> showListComment(@Param("dto") CommentPageDto dto);

    int showListCount(@Param("dto") CommentPageDto dto);
}